﻿using System;
using System.Collections;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using VTemplate;
using VTemplate.Engine;

using FL.Common;
using FL.Bussiness;
using FL.DBModule;
using FL.SiteEntity;
using FL.Bussiness.Site;

namespace FL.Test
{
    [TestClass]
    public class TemplateTest
    {
        [TestMethod]
        public void TestTemplate()
        {  //<vt:foreach from=""articles"" item=""article"" index=""i"">
           string strTempalte = @"
             <div class=""row"">
             	<div class=""col-md-12"">
                    <p class=""contentList""><a href="""">{$:article.title}</a></p>
                    <p class=""contentCent""><a href="""">{$:article.zhaiyao}</a></p>
                    <p class=""contenticon"">
                    	<span class=""fl""><img src=""img/calendar.png"" alt=""""></span><span class=""Spanmar"">{$:article.add_time}</span>
                        <span class=""fl""><img src=""img/message.png"" alt=""""></span><span class=""Spanmar"">{$:article.review_count}35人评论&nbsp;&nbsp;&nbsp;&nbsp;</span>
                        <span class=""fl""><img src=""img/eyes.png"" alt=""""></span><span class=""Spanmar"">{$:article.read_count}次浏览</span>
                    </p>
                </div>
             </div>
             {$:testName}
             <hr>";
           ///<vt:foreachelse />
          // 没有任何数据
          // </vt:foreach>";
          BArticle BA = new BArticle();
          IList<v_t_site_article> list = BA.GetEntitys<v_t_site_article>();
          TemplateDocument doc = new TemplateDocument(strTempalte);
          doc.SetValue("article", list[0]);
          doc.SetValue("testName", "江怀玉");
          string test = doc.GetRenderText();
          //doc.Render()
          
          //Template t = new Template();
          //t.Render()

             
//            

//{$:i}、我叫{$:user.name},今年{$:user.age}岁

//<vt:foreachelse />

//没有任何用户

//</vt:foreach>


        }
    }
}
